{% extends 'mobile/minimal.html' %}

{% from "wiki/includes/document_macros.html" import contributor_list, document_title, document_messages, document_content  %}

{% set title = _('{t} | {c}')|f(t=document.title, c=document.get_category_display()) %}

{% set styles = ('mobile-wiki-minimal',) %}
{% set classes = 'document' %}
{% set scripts = ('mobile-wiki-minimal',) %}
{% set canonical_url = canonicalize(model_url=document.get_absolute_url()) %}
{% if document.is_template or document.is_archived %}
  {% set meta = (('robots', 'noindex'),) %}
{% endif %}

{% if document.parent %}
  {# If there is a parent doc, use its URL for switching locales. #}
  {% set localizable_url = url('wiki.document', document.parent.slug, locale=settings.WIKI_DEFAULT_LANGUAGE) %}
{% endif %}

{% block content %}
  <div class="title-bar">{{ document_title(document) }}</div>
  <article id="wiki-doc">
    {{ document_messages(document, redirected_from) }}
    {{ document_content(document, fallback_reason, request, settings, document_css_class, any_localizable_revision, full_locale_name) }}

    {% set share_link = document.share_link or (document.parent and document.parent.share_link) %}
    {% if share_link %}
      <p class="share-link">
        <br/>
        {% set link='<a href="' + share_link + '">' + share_link + '</a>' %}
        {{ _('Share this article: {link}')|f(link=link|safe) }}
      </p>
    {% endif %}

    {{ contributor_list(contributors) }}
  </article>
{% endblock %}
